#include <stdio.h>
#include <string.h>

int main()
{
    char str[] = "Hello, World! Welcome to C programming.";
    const char delim[] = " ,.!"; // 以空格、逗号和句号作为分隔符
    char *token;

    // 获取第一个子字符串
    token = strtok(str, delim);

    // 依次获取剩下的子字符串
    while (token != NULL)
    {
        printf("%s\n", token);
        token = strtok(NULL, delim);
    }

    return 0;
}

